﻿using _01_Tower4._0.GameFrame.System;
using _01_Tower4._0.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _01_Tower4._0.Items.Base
{
    internal class Consumable : Item//10
    {
        public int Hp { get; protected set; }
        public int MaxHp { get; protected set; }
        public int Mp { get; protected set; }
        public int Def { get; protected set; }
        public int Atk { get; protected set; }
        public Consumable(int id, string name, string description,string feedBack, int hp, int maxHp, int mp,int def,int atk) : base(id, name, description,feedBack)
        {
            Hp = hp;
            MaxHp = maxHp;
            Mp = mp;
            Def = def;
            Atk = atk;
        }

        public void Use(IAttack target)
        {
            target.Hp += Hp;
            target.MaxHp += MaxHp;
            target.Mp += Mp;
            if(target.Mp > target.MaxMp)target.Mp = target.MaxMp;
            target.Def += Def;
            target.Atk += Atk;
            InfoSystem.Instance.AddInfo(FeedBack);
        }
    }
}
